<form class="layui-form layui-card" action="{:request()->url()}" data-auto="true" method="post" autocomplete="off">
    <div class="layui-card-body padding-left-40">
        <div class="layui-form-item">
            <label class="layui-form-label">广告位名称</label>
            <div class="layui-input-block">
                <input name="name" value='{$vo.name|default=""}' required placeholder="请输入广告位名称" class="layui-input">
                <p class="help-block">必填，请填写广告位名称（如：首页banner），建议字符不要太长，一般4-6个汉字</p>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">广告位类型</label>
            <div class="layui-input-block">
                <select name='type' class='layui-select' lay-search required>
                    {foreach :config('constant.advCatType') as $key => $advCate}
                    {eq name='key' value='$vo.type|default="img"'}
                    <option selected value='{$key}'>{$advCate}</option>
                    {else}
                    <option value='{$key}'>{$advCate}</option>
                    {/eq}
                    {/foreach}
                </select>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">广告位尺寸</label>
            <div class="layui-input-block">
                <div class="layui-col-xs5">
                    <input name="width" autocomplete="off" pattern="^[\d]+$" value='{$vo.width|default=""}' required placeholder="请输入广告位宽度" class="layui-input">
                </div>
                <div class=" layui-col-md-offset2 layui-col-xs5">
                    <input name="height" autocomplete="off" pattern="^[\d]+$" value='{$vo.height|default=""}' required placeholder="请输入广告位高度" class="layui-input">
                </div>
                <p>单位：px(像素)</p>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">描述</label>
            <div class="layui-input-block">
                <textarea placeholder="请输入广告描述" class="layui-textarea" name="description">{$vo.description|default=""}</textarea>
            </div>
        </div>

        <div class="hr-line-dashed"></div>
        {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
        <div class="layui-form-item text-center">
            <button class="layui-btn" type='submit'>保存数据</button>
            <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗？" data-close>取消编辑</button>
        </div>
    </div>
</form>

{block name='script'}
<script>
    layui.form.render();
</script>
{/block}